<%@ taglib prefix="input" uri="/struts-tags" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
    #no_scale{margin-left: 2%;}
</style>
<%--<x:parse xml="${param.xmlstr}" var="xmlData" />--%>
<c:set var="nature_value">
    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" />
</c:set>
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>" />
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>" />
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>" />
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>" />
<div class="t_bar">
    团队建设情况
</div>
<table class="table01 t_css" width="100%" border="0" cellpadding="0" id="basicInfo_tb" cellspacing="1">
    <col style="width: 10%" />
    <col style="width: 15%" />
    <col style="width: 15%" />
    <col style="width: 15%" />
    <col style="width: 15%" />
    <col style="width: 15%" />
    <col style="width: 15%" />

    <tr>
        <td align="right" colspan="2"><span class="color_red">*</span>科技特派团名称：</td>
        <td colspan="5">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 76%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="科技特派团名称">
        </td>
    </tr>

    <tr>
        <td align="right" colspan="2"><span class="color_red">*</span>归口管理部门：</td>
        <td colspan="3">
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}" width="75%"  label="归口管理部门"
                      id="recomend_org" onlyChooseLeaf="false"  showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
        <td align="right" ><span class="color_red">*</span>申报时间：</td>
        <td ><c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
            <cpt:date id="apply_date_curr"  name="proposal/submit_date" value="${submit_date}" className="required date" size="10" label="申报时间" ></cpt:date>
        </td>
    </tr>
    <input type="hidden" id="submit_psn" name="zh_persons/zh_person[0]@submit_psn" value="1" />
    <input type="hidden" name="zh_persons/zh_person[0]@seq_no" value="1">
    <tr>
        <td align="center" rowspan="4">团长</td>
        <td align="right">姓名：</td>
        <td>
            <span name="zh_persons/zh_person[0]/basic_info/zh_name">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" />
            </span>
        </td>
        <td align="right">性别：</td>
        <td>
            <c:set var="gender_value"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/gender_value" /></c:set>
            <c:choose>
                <c:when test="${gender_value == 'F' || gender_value == 'M'}">
                    <c:if test="${gender_value == 'F'}"><span name="zh_persons/zh_person[0]/basic_info/gender_name">女</span></c:if>
                    <c:if test="${gender_value == 'M'}"><span name="zh_persons/zh_person[0]/basic_info/gender_name">男</span></c:if>
                </c:when>
            </c:choose>
        </td>
        <td align="right">出生年月：</td>
        <td>
            <span name="zh_persons/zh_person[0]/basic_info/birthday">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/birthday" />
            </span>
        </td>
    </tr>
    <tr>
        <td align="right">派出单位：</td>
        <td>
            <span name="zh_persons/zh_person[0]/basic_info/org_name">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/org_name" />
            </span>
        </td>
        <td align="right">职务/职称：</td>
        <td>
            <span name="zh_persons/zh_person[0]/basic_info/position">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/position" />
            </span>/
            <span name="zh_persons/zh_person[0]/basic_info/prof_title_name">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" />
            </span>
        </td>
        <td align="right">身份证号码：</td>
        <td>
            <span name="zh_persons/zh_person[0]/basic_info/card_code">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/card_code" />
            </span>
        </td>
    </tr>
    <tr>
        <td align="right">学位：</td>
        <td>
            <span name="zh_persons/zh_person[0]/basic_info/degree_name">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/degree_name" />
            </span>
        </td>
        <td align="right">所学专业：</td>
        <td>
            <span name="zh_persons/zh_person[0]/contact/major">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/major" />
            </span>
        </td>
        <td align="right">从事专业：</td>
        <td>
            <span name="zh_persons/zh_person[0]/contact/major_work">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/major_work" />
            </span>
        </td>
    </tr>
    <tr>
        <td align="right">联系电话：</td>
        <td>
            <span name="zh_persons/zh_person[0]/contact/tel_work">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" />
            </span>
        </td>
        <td align="right">手机：</td>
        <td>
            <span name="zh_persons/zh_person[0]/contact/mobile">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" />
            </span>
        </td>
        <td align="right">E-mail：</td>
        <td>
            <span name="zh_persons/zh_person[0]/contact/email">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" />
            </span>
        </td>
    </tr>
    <tr>
        <td align="center" rowspan="2"><span class="color_red">*</span>联系人</td>
        <td align="right">姓名：</td>
        <td colspan="2">
            <input   name="proposal/contact_psn_cname" label="联系人-->姓名" type="text"  class="input_css required"   maxlength="50"
                     value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/>
        </td>
        <td align="right">手机：</td>
        <td colspan="2">
            <input name="proposal/contact_psn_mobile" label="联系人-->手机" type="text" onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11"
                   class="input_css required mobile"  value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />"/>
        </td>
    </tr>
    <tr>

        <td align="right">联系电话：</td>
        <td colspan="2">
            <input name="proposal/contact_psn_tel_work" label="联系人-->联系电话" type="text" required class="input_css required"  maxlength="20"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_tel_work" />"/>
        </td>

        <td align="right">E-mail：</td>
        <td colspan="2">
            <input name="proposal/contact_psn_email" label="联系人-->E-mail" type="text" required class="input_css required email"   maxlength="50"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/>
        </td>

    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>团长近三年产学研合作方面主要业绩：</td>
        <td colspan="6">
            <textarea name="proposal/summary1" style="width:98%" class="input_textarea required maxlength:150"
                      placeholder="团长近三年产学研合作方面主要业绩。（150字内）"
                      label="团长近三年产学研合作方面主要业绩" rows=5 cols=60><x:out select="$xmlData/data/proposal/summary1"/></textarea>
            <input type="hidden" name="proposal/summary1_hidden" id="proposal/summary1_hidden"
                   value="<x:out select="$xmlData/data/proposal/summary1" />"/>
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>其他组建单位情况，包括单位基本简介：</td>
        <td colspan="6">
            <textarea name="proposal/summary2" style="width:98%" class="input_textarea required maxlength:200"
                      placeholder="其他组建单位情况，包括单位基本简介。（200字内）"
                      label="其他组建单位情况，包括单位基本简介" rows=5 cols=60><x:out select="$xmlData/data/proposal/summary2"/></textarea>
            <input type="hidden" name="proposal/summary2_hidden" id="proposal/summary2_hidden"
                   value="<x:out select="$xmlData/data/proposal/summary2" />"/>
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>与市县产学研合作情况：</td>
        <td colspan="6">
            <textarea name="proposal/summary3" style="width:98%" class="input_textarea required maxlength:300"
                      placeholder="企业同时需填报：企业性质（省属企业、市属企业等），上年度营业收入（万元），主营业务领域。（300字内）"
                      label="与市县产学研合作情况" rows=5 cols=60><x:out select="$xmlData/data/proposal/summary3"/></textarea>
            <input type="hidden" name="proposal/summary3_hidden" id="proposal/summary3_hidden"
                   value="<x:out select="$xmlData/data/proposal/summary3" />"/>
        </td>
    </tr>
</table>

<div class="t_bar">
    <strong>团队成员情况</strong>
</div>
<table  id="prj_teampersons" border="0" cellspacing="0" cellpadding="0" class="table01">
    <col style="width: 5%" />
    <col style="width: 5%" />
    <col style="width: 13%" />
    <col style="width: 10%" />
    <col style="width: 12%" />
    <col style="width: 10%" />
    <col style="width: 10%" />
    <col style="width: 15%" />
    <col style="width: 15%" />
    <thead>
    <tr>
        <th align="center">选择</th>
        <th align="center">序号</th>
        <th align="center">姓名</th>
        <th align="center">派出（所在）单位</th>
        <th align="center">出生年月</th>
        <th align="center">学历</th>
        <th align="center">从事专业</th>
        <th align="center">身份证号码</th>
        <th align="center">联系方式</th>

    </tr>
    </thead>
    <tbody id="tab1">
    <tr style="display:none">
        <td align="center">
            <input type="radio" class="radiobutton" name="selectpersons" >
        </td>
        <td align="center">
            <span name="team_members|team_member[0]@seq_no" >[index]</span>
        </td>
        <td align="center">
            <input name="team_members|team_member[0]|zh_name" class="input_text required" label="姓名"  maxlength="30" style="width: 80%;"/>
        </td>
        <td align="center">
            <input name="team_members|team_member[0]|org_name" class="input_text required" label="派出（所在）单位" maxlength="30" style="width: 80%;"/>
        </td>
        <td align="center">
            <input id="birth_date_[0]" name="team_members|team_member[0]|birthday_date" label="出生年月" value=""
                   class=" required input_text date  " style="width: 60%"/>
        </td>

        <td align="center">
            <cpt:select key="educate" id="educate[index]" onChange="initControlValue(this.id);" value=""  name="educate"/>
            <input type="hidden" id="educate[index]_value" name="team_members|team_member[0]|educate_value" value="" class="required" label="学历"/>
            <input type="hidden" id="educate[index]_name" name="team_members|team_member[0]|educate_name" value=""/>
        </td>
        <td align="center">
            <input name="team_members|team_member[0]|major_work" class="input_text required" label="从事专业"  maxlength="30" style="width: 80%;"/>
        </td>
        <td align="center">
            <input name="team_members|team_member[0]|card_code" class="input_text required idCard" label="身份证号码"  maxlength="30" style="width: 80%" />
        </td>
        <td align="center">
            <input name="team_members|team_member[0]|tel_work" class="input_text required" label="联系方式"  maxlength="20" style="width: 80%;"/>
        </td>
    </tr>

    <c:set value="0" var="index" scope="page"/>
    <x:forEach select="$xmlData/data/team_members/team_member" var="team_member" begin="0">
        <c:choose>
            <c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
            <c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
        </c:choose>
        <tr>
            <td align="center">
                <input type="radio" class="radiobutton" name="selectpersons" >
            </td>
            <td align="center">
                <span name="team_members/team_member[${flag}${index}]@seq_no" ><x:out select="$team_member/@seq_no"/></span>
            </td>
            <td align="center">
                <input name="team_members/team_member[${flag}${index}]/zh_name"  class="input_text required" label="姓名"
                       value="<x:out select="$team_member/zh_name"/>" maxlength="30"  style="width: 80%;"/>
            </td>
            <td align="center">
                <input name="team_members/team_member[${flag}${index}]/org_name" class="input_text required" label="派出（所在）单位" maxlength="30"
                       style="width: 80%;" value="<x:out select="$team_member/org_name"/>"/>
            </td>
            <td align="center">
                <input id="birth_date_${flag}${index}" name="team_members/team_member[${flag}${index}]/birthday_date" label="出生年月"
                       value="<x:out select="$team_member/birthday_date"/>" class=" required input_text date  " style="width: 60%"/>
            </td>

            <td align="center">
                <c:set var="educate_value"><x:out select="$team_member/educate_value"/></c:set>
                <cpt:select key="educate" id="educate_${flag}${index}" onChange="initControlValue(this.id);" value="${educate_value}"  name="educate"/>
                <input type="hidden" id="educate${flag}${index}_value" name="team_members/team_member[${flag}${index}]/educate_value"
                       value="${educate_value}" class="required" label="学历"/>
                <input type="hidden" id="educate${flag}${index}_name" name="team_members/team_member[${flag}${index}]/educate_name"
                       value="<x:out select="$team_member/educate_name"/>"/>
            </td>
            <td align="center">
                <input name="team_members/team_member[${flag}${index}]/major_work" class="input_text required" label="从事专业"  maxlength="30"
                       style="width: 80%;" value="<x:out select="$team_member/major_work"/>"/>
            </td>
            <td align="center">
                <input name="team_members/team_member[${flag}${index}]/card_code" class="input_text required idCard" label="身份证号码"  maxlength="30"
                       style="width: 80%" value="<x:out select="$team_member/card_code"/>" />
            </td>
            <td align="center">
                <input name="team_members/team_member[${flag}${index}]/tel_work" class="input_text required" label="联系方式"  maxlength="20"
                       style="width: 80%;" value="<x:out select="$team_member/tel_work"/>"/>
            </td>
        </tr>
        <c:set value="${index+1}" var="index" scope="page"/>
    </x:forEach>

    <script type="text/javascript">
        showAllDateTag("prj_teampersons");
    </script>
    </tbody>
</table>

<br />
<table width="98%" align="center">
    <tr >
        <td>
            <input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('prj_teampersons',10,'团队成员情况最多只能填写10条')){addNewRow('prj_teampersons');showDateTag('prj_teampersons');}try{top.resizeFrame();}catch(e){};">
            <input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('prj_teampersons','selectpersons')">
            <input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('prj_teampersons','selectpersons')">
            <input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('prj_teampersons','团队成员情况');">
        </td>
    </tr>
</table>

<script type="text/javascript">

    function initTreeValueExt(treeId, treeNode) {
        if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
            if (treeNode.level == 0) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
            }

            return false;
        }


        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val(str);
    }

    function changeCss(id) {
        $("#"+id+">tbody>tr:odd").each(function(){
            $(this).removeClass().addClass("li_1");
        });
        $("#"+id+">tbody>tr:even").each(function(){
            $(this).removeClass().addClass("li_2");
        });
    }
</script>
